package com.qs.controller;

/**
 * ClassName: EsController
 * Package: com.qs.controller
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2024/3/29 - 16:31
 * @Version: v1.0
 */

import com.qs.task.EsTask;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 这个请求不进行对外暴露
 * 预热es商品和店铺数据
 */
@RestController
@RequiredArgsConstructor
public class EsController {

    private final EsTask esTask;

    /**
     * 商品数据预热
     */
    @GetMapping("/goods/preheat")
    public void goodsPreheat(){
        esTask.saveGoodsToEsTask();
    }

    /**
     * 店铺数据预热
     */
    @GetMapping("/store/preheat")
    public void storePreheat(){
        esTask.saveStoreToEsTask();
    }
}
